/*
 Navicat Premium Data Transfer

 Source Server         : 本地连接
 Source Server Type    : MySQL
 Source Server Version : 80012
 Source Host           : 127.0.0.1:3306
 Source Schema         : quick_framework

 Target Server Type    : MySQL
 Target Server Version : 80012
 File Encoding         : 65001

 Date: 08/01/2019 16:06:46
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `menu_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '菜单主键',
  `parent_menu_id` bigint(20) unsigned DEFAULT '0' COMMENT '父级菜单主键[form,excel,exists:target=SysMenuServiceImpl]',
  `title` varchar(16) NOT NULL COMMENT '菜单标题[form,table,excel]',
  `icon` varchar(32) NOT NULL COMMENT '菜单图标[form,table,excel]',
  `component` varchar(16) NOT NULL COMMENT '菜单组件[form,table,excel]',
  `path` varchar(32) NOT NULL COMMENT '菜单路径[form,table,excel]',
  `redirect` varchar(32) DEFAULT NULL COMMENT '重定向路径[form,table,excel]',
  `hidden` tinyint(3) unsigned DEFAULT '0' COMMENT '是否隐藏[form,table,excel,typeConvert:class=java.lang.Boolean]',
  `always_show` tinyint(3) unsigned DEFAULT '0' COMMENT '是否一直显示[form,table,excel,typeConvert:class=java.lang.Boolean]',
  `no_cache` tinyint(3) unsigned DEFAULT '0' COMMENT '是否不缓存[form,table,excel,typeConvert:class=java.lang.Boolean]',
  `sequence` int(10) unsigned DEFAULT '1' COMMENT '菜单排序[form,table,excel,integer]',
  `remark` varchar(256) DEFAULT NULL COMMENT '菜单备注[form,excel]',
  `operation_user_id` bigint(20) unsigned NOT NULL COMMENT '操作用户主键',
  `operation_user_name` varchar(8) NOT NULL COMMENT '操作用户姓名',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`menu_id`),
  KEY `idx_sys_menu_operation_user_id` (`operation_user_id`),
  KEY `idx_sys_menu_parent_menu_id` (`parent_menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统菜单';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES (1, 0, '系统管理', 'component', 'Layout', '/sys', '/sys/sys-menu', 0, 1, 0, 1, '系统管理', 1, '超级管理员', '2018-12-30 17:36:23', '2019-01-01 11:40:53');
INSERT INTO `sys_menu` VALUES (2, 1, '系统菜单', 'nested', 'SysMenu', 'sys-menu', '', 0, 0, 0, 1, '菜单管理', 1, '超级管理员', '2018-12-30 17:38:17', '2019-01-02 19:07:23');
INSERT INTO `sys_menu` VALUES (3, 8, '系统用户', 'peoples', 'SysUser', 'sys-user', '', 0, 0, 0, 1, '系统用户', 1, '超级管理员', '2018-12-30 17:58:33', '2019-01-08 15:39:44');
INSERT INTO `sys_menu` VALUES (4, 8, '系统角色', 'role', 'SysRole', 'sys-role', '', 0, 0, 0, 2, '系统角色', 1, '超级管理员', '2019-01-02 13:14:53', '2019-01-08 15:40:28');
INSERT INTO `sys_menu` VALUES (5, 8, '系统权限', 'permission', 'SysPermission', 'sys-permission', '', 0, 0, 0, 3, '系统权限', 1, '超级管理员', '2019-01-02 18:58:27', '2019-01-08 15:40:43');
INSERT INTO `sys_menu` VALUES (6, 0, '日志管理', 'documentation', 'Layout', '/log', '/log/sys-message-log', 0, 1, 0, 1, '管理系统中的所有日志', 1, '超级管理员', '2019-01-06 09:26:41', '2019-01-06 09:58:02');
INSERT INTO `sys_menu` VALUES (7, 6, '消息日志', 'message', 'SysMessageLog', 'sys-message-log', '', 0, 0, 0, 1, 'RabbitMQ消息队列的消息日志', 1, '超级管理员', '2019-01-06 09:28:33', '2019-01-06 09:58:11');
INSERT INTO `sys_menu` VALUES (8, 0, '权限管理', 'permission-management', 'Layout', '/auth', '/auth/sys-user', 0, 1, 0, 3, '权限管理', 1, '超级管理员', '2019-01-08 15:24:31', '2019-01-08 15:47:46');
COMMIT;

-- ----------------------------
-- Table structure for sys_message_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_message_log`;
CREATE TABLE `sys_message_log` (
  `message_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '任务主键',
  `title` varchar(64) NOT NULL COMMENT '标题[form,table,excel,search]',
  `content` text NOT NULL COMMENT '任务内容[excel,form]',
  `status` char(1) NOT NULL DEFAULT 'a' COMMENT '状态[form,table,search,excel:method=getMeaning,enum:sending=a-投递中&sending_success=b-投递成功&sending_failure=c-投递失败&handling_failure=d-处理失败,typeConvert:class=amqp.enumeration.SysMessageLogStatusEnum]',
  `try_count` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '重试次数[form,table,excel,search]',
  `next_retry_time` timestamp NULL DEFAULT NULL COMMENT '下次重试时间[table,excel]',
  `operation_user_id` bigint(20) unsigned NOT NULL COMMENT '操作用户ID[nod]',
  `operation_user_name` varchar(8) NOT NULL COMMENT '操作用户[table,excel]',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间[table,excel]',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间[excel]',
  PRIMARY KEY (`message_id`),
  KEY `idx_sys_message_log_next_retry_time` (`next_retry_time`),
  KEY `idx_sys_message_log_operation_user_id` (`operation_user_id`),
  KEY `idx_sys_message_log_status` (`status`),
  KEY `idx_sys_message_log_try_count` (`try_count`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统消息日志';

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `permission_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '权限ID',
  `parent_permission_id` bigint(20) unsigned DEFAULT '0' COMMENT '父级权限[form,excel,nod]',
  `name` varchar(32) NOT NULL COMMENT '名称[form,table,excel]',
  `rule` tinyint(3) unsigned DEFAULT '0' COMMENT '是否是规则[form,table,excel,typeConvert:class=java.lang.Boolean]',
  `uri` varchar(128) DEFAULT NULL COMMENT '请求URI[form,table,excel,path]',
  `method` char(1) DEFAULT 'a' COMMENT '请求方法[form,table,excel:method=getMeaning,enum:get=a-GET&post=b-POST&put=c-PUT&delete=d-DELETE,typeConvert:class=system.enumeration.SysPermissionMethodEnum]',
  `remark` varchar(256) DEFAULT NULL COMMENT '备注[form,excel]',
  `operation_user_id` bigint(20) unsigned NOT NULL COMMENT '操作用户ID[nod]',
  `operation_user_name` varchar(8) NOT NULL COMMENT '操作用户[table,excel]',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间[table,excel]',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间[excel]',
  PRIMARY KEY (`permission_id`),
  KEY `idx_sys_permission_operation_user_id` (`operation_user_id`),
  KEY `idx_sys_permission_parent_permission_id` (`parent_permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统权限';

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` VALUES (1, 0, '系统管理', 0, '', 'a', '系统管理', 1, '超级管理员', '2019-01-02 20:46:44', '2019-01-02 20:46:44');
INSERT INTO `sys_permission` VALUES (2, 1, '系统菜单', 1, '/sys/sys-menu/**', 'e', '系统菜单权限', 1, '超级管理员', '2019-01-02 20:52:45', '2019-01-04 21:47:59');
INSERT INTO `sys_permission` VALUES (3, 1, '系统用户', 1, '/sys/sys-user/**', 'e', '系统用户权限', 1, '超级管理员', '2019-01-02 20:53:24', '2019-01-04 16:50:10');
INSERT INTO `sys_permission` VALUES (4, 1, '系统角色', 1, '/sys/sys-role/**', 'e', '系统角色权限', 1, '超级管理员', '2019-01-02 20:53:49', '2019-01-04 16:50:18');
INSERT INTO `sys_permission` VALUES (5, 1, '系统权限', 1, '/sys/sys-permission/**', 'e', '系统权限权限', 1, '超级管理员', '2019-01-02 20:54:26', '2019-01-04 16:50:24');
INSERT INTO `sys_permission` VALUES (6, 0, '日志管理', 0, '', 'a', '日志管理', 1, '超级管理员', '2019-01-06 12:52:38', '2019-01-06 12:52:38');
INSERT INTO `sys_permission` VALUES (7, 6, '消息日志', 1, '/sys/sys-message-log/**', 'e', '消息日志', 1, '超级管理员', '2019-01-06 12:53:45', '2019-01-06 12:53:45');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `role_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色ID',
  `name` varchar(16) NOT NULL COMMENT '名称[form,table,excel,search,unique:service=SysRoleServiceImpl&method=nameExists]',
  `status` char(1) DEFAULT 'a' COMMENT '状态[form,table,excel:method=getMeaning,search,enum:enabled=a-启用&disabled=b-停用,typeConvert:class=system.enumeration.SysRoleStatusEnum]',
  `data_operation_range` char(1) DEFAULT 'a' COMMENT '数据操作范围[form,table,excel:method=getMeaning,search,enum:all=a-所有的数据&self=b-自己的数据,typeConvert:class=system.enumeration.SysRoleDataOperationRangeEnum]',
  `remark` varchar(256) NOT NULL COMMENT '备注[form,excel]',
  `operation_user_id` bigint(20) unsigned NOT NULL COMMENT '操作用户ID[nod]',
  `operation_user_name` varchar(8) NOT NULL COMMENT '操作用户[table,excel]',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间[table,excel]',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间[excel]',
  PRIMARY KEY (`role_id`),
  UNIQUE KEY `uk_sys_role_name` (`name`),
  KEY `idx_sys_role_status` (`status`),
  KEY `idx_sys_role_operation_user_id` (`operation_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统角色';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES (1, '超级管理员', 'a', 'a', '超级管理员角色，权限最大', 1, '超级管理员', '2019-01-02 14:03:04', '2019-01-03 16:49:04');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `role_id` bigint(20) unsigned NOT NULL COMMENT '角色ID',
  `permission_id` bigint(20) unsigned NOT NULL COMMENT '权限ID',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统角色权限';

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户主键',
  `account` varchar(16) NOT NULL COMMENT '用户账号[form,table,excel,alphaNum,search]',
  `password` varchar(64) NOT NULL COMMENT '用户密码[form,alphaDash]',
  `name` varchar(8) NOT NULL COMMENT '用户姓名[form,table,excel,chinese]',
  `avatar` varchar(256) NOT NULL COMMENT '用户头像[form,excel,img]',
  `phone` varchar(16) DEFAULT NULL COMMENT '联系电话[form,table,excel,phone]',
  `email` varchar(32) DEFAULT NULL COMMENT '联系邮箱[form,table,excel,email]',
  `remark` varchar(256) DEFAULT NULL COMMENT '用户备注[form,excel]',
  `status` char(1) NOT NULL DEFAULT 'a' COMMENT '用户状态[form,table,excel,enum:enabled=a-启用&disabled=b-停用,typeConvert:class=system.enumeration.SysUserStatusEnum]',
  `operation_user_id` bigint(20) unsigned NOT NULL COMMENT '操作用户[nod]',
  `operation_user_name` varchar(8) NOT NULL COMMENT '操作用户姓名',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `uk_sys_user_account` (`account`),
  KEY `idx_sys_user_operation_user_id` (`operation_user_id`),
  KEY `idx_sys_user_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$d0KLc4LakfT4Gf/MvoqoROcEoyUY4tHiEMG9IZbFJyeyGGJScIih.', '超级管理员', 'img/74537c35-2906-435f-9ee4-941ed56a43ef', '19909407240', '2929923469@qq.com', '超级管理员，权限最大', 'a', 1, '超级管理员', '2019-01-04 11:09:00', '2019-01-05 22:24:59');
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `user_id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
  `role_id` bigint(20) unsigned NOT NULL COMMENT '角色ID',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统用户角色';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES (1, 1, '2019-01-04 11:13:30', '2019-01-04 11:13:30');
COMMIT;